#!/bin/bash
# 
read -p "进程名称:" process

if ! ps -elf | grep "$process"  &> /dev/null; then 
   echo "进程${process}没有启动"
else
  pid=$(pidof $process)
  port=$(netstat -tunlp | grep "$process" | awk '{print $4}' | awk -F: '{print $4}')
   start_time=$(ps -elf | grep $process | awk '{print $12}')
  echo "启动时间：$start_time  服务名称：$process  进程ID：$pid 端口：$port "
fi
